import React, { memo, useEffect } from 'react';
import { useSelector, useDispatch, shallowEqual } from 'react-redux';
import { changeNewsAction } from '../store/actionCreators';

import './main.less';

export default memo(function Main(props) {
  const { news } = useSelector(
    (state) => ({
      news: state.getIn(['index', 'news']),
    }),
    shallowEqual,
  );

  const dispatch = useDispatch();

  useEffect(() => {
    dispatch(changeNewsAction());
  }, [dispatch]);

  return <div className="main">御坂美琴</div>;
});
